package com.ossjk.oa.attendance.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.ossjk.oa.attendance.entity.Atdreport;
import com.ossjk.oa.attendance.entity.Vemp2Dept;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 考勤申报 Mapper 接口
 * </p>
 *
 * @author chair
 * @since 2019-02-03
 */
public interface AtdreportMapper extends BaseMapper<Atdreport> {
	List selectVoPage(Page page, @Param("ew") Wrapper wrapper);
	Vemp2Dept selectDaoHao(@Param("ew")Wrapper wapper);
	List selectDetail(@Param("ew") Wrapper wrapper);
	List selectVo( @Param("ew") Wrapper wrapper);
	@Select("select   left(max(date),7) from atdreport where date<(select min(date) from atdreport where left(date,7) = #{mth}) order by date desc")
	String selectPreMth(String mth);

	@Select("select   left(min(date),7) from atdreport where date>(select max(date) from atdreport where left(date,7) = #{mth}) order by date")
	String selectNextMth(String mth);
}
